package main

import "fmt"

// 使用 map 作计数器
func main() {
	temperatures := []float64{
		-28.1, 32.0, -31.0, -29.0, -23.0, -29.0, -28.0, -33.0,
	}

	frequency := make(map[float64]int)

	for _, item := range temperatures {
		frequency[item]++
	}

	// 无法保证遍历顺序
	for key, value := range frequency {
		fmt.Printf("%+.2f occurs %d times\n", key, value)
	}
}
